package com.learn.spring.bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

/**
 * @author wangxing
 * @version 2020/5/7 18:50 Administrator
 */
@Controller("person")
public class Person extends Bean {
    @Value("王星")
    private String name;
    @Value(value = "#{35-5}")
    private Integer age;
    @Value("${person.address}")
    private String address;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    static {
        System.out.println("==============加载Person类");
    }

    {
        System.out.println("==============初始化Person对象");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void init() {
        System.out.println("person 初始化");
    }

    public void destroy() {
        System.out.println("person 销毁");
    }
}
